#include <stdio.h>
#include <stdbool.h>

int main(){
	int number = 0;
	int step = 0;
	//输入不大于1000的正整数
	do{
		printf("请输入一个整数:\n");
		scanf("%d", &number);	
	}while(number > 1000 || number <= 0);
	//算步数
	do{
		if(number == 1){
			break;
		}
		number = (number % 2 == 0)?(number / 2):((3 * number + 1) / 2);
		++step;
	}while(1);
	//输出
	printf("步数:%d\n",step);
	return 0;
}
